<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>4-元素显示模式-相互转换</title>
    <style>
        .box{
            width: 600px;
            height: 600px;
            border-radius: 5px;
            border: 2px dashed red;
            margin: 30px auto;
            text-align: center;
        }
        .box a{
            display: block;
            width: 200px;
            height: 200px;
            border: 1px solid green;
            margin: 0 auto;
            margin-top: 200px;
        }
        .box1 p{
            display: inline;
            display: inline-block;
        }
    </style>
</head>
<body>
    <!-- 
        为什么需要转换？
            知识点：
                块元素 display:block;
                行内元素：display:inline;
                行内块元素:display:inline-block;
     -->
    <!-- 1.行内元素inline转换为块元素block -->
    <div class="box">
        <!-- <img src="images/200.png" alt=""> -->
        <a href=""><img src="images/200.png" alt=""></a>
    </div>
    <hr>
    <!-- 2.块元素转为行内元素/行内块元素 -->
    <div class="box1">
        <p>西安</p>
        <p>下雨</p>
        <p>了</p>
    </div>
</body>
</html>